get current month name python

55

get current month name python -

import calendar
from datetime import date

current_month_name = calendar.month_name[date.today().month]
# the variable will hold something like 'April'

#if you want the abbreviated version:
current_month_name_abbreviated = calendar.month_abbr[date.today().month]
# the variable will hold something like 'Apr' now instead of 'April'

get name of month python -

calendar.month_name[2]

Comments

Submit
0 Comments